package helpers;

import java.io.IOException;
import java.io.InputStream;

public class StreamHelpers {
    public static String readSuppressExceptionsAndClose(InputStream stream) {
        StringBuilder content = new StringBuilder();
        try {
            try {
                for (int cp = stream.read(); cp != -1; cp = stream.read())
                    content.appendCodePoint(cp);
            } catch (IOException e) {
            }
        } finally {
            try {
                stream.close();
            } catch (IOException e) {
            }
        }
        return content.toString();

    }
}
